package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class TryFinally01 {
    public static void main(String[] args) {
//        try {
//            doMethod(100,0);
////        }catch (Exception e){
////            System.out.println("调用宏方发出异常了");
////        }

    }
    static void doMethod(Integer a,Integer b){
        int c = -1;
        try {
            //假如异常没有处理，异常会抛出给方法调用者
            int d = a.intValue(); //肯能会出现空指针异常
            c = a / b; //可能会出现算数异常
        }finally {
            c++;
        }
        System.out.println(c);
    }
}
